package org.example.item.ball;

import org.example.models.abstracts.AbstractItem;

import java.util.Objects;

public class Ball extends AbstractItem {
    private final String color;
    public Ball(String color) {
        super("Ball");
        this.color = color;
    }

    public String getColor() {
        return color;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Ball ball)) return false;
        return Objects.equals(getColor(), ball.getColor());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getColor());
    }

    @Override
    public String toString() {
        return "Ball[color=" + color + "]";
    }
}
